This invention relates to contrast determining apparatus and methods and in particular, but not exclusively, to such apparatus and methods for measuring the contrast of marks on wires and cables. The invention however extends to contrast measurement in general and extends to diverse applications such as the measurement of the contrast in a bar code mark.
The high legibility of user applied marks on wires and cables used in the aerospace industry is of critical importance and is an accepted requirement. However scientific, measurement of xe2x80x9clegibilityxe2x80x9d has yet to be established. At present only one aspect of legibility, namely contrast measurement of marks, may be determined. In a conventional contrast measurement system for wires and cables, a photometer incorporating a photopic filter intended to match the human eye""s response is used to measure the luminance at a point on the xe2x80x9cblackxe2x80x9d mark or other indicia and at a point on the xe2x80x9cwhitexe2x80x9d background. These readings are taken one after the other and then used to calculate the contrast. The terms xe2x80x9cblackxe2x80x9d and xe2x80x9cwhitexe2x80x9d are approximate terms because of course these areas will not show 0% and 100% reflectivity.
There are several drawbacks with the existing systems. Firstly the readings are taken one after the other which means that the lighting or other conditions may change, between readings. Furthermore, to take the two readings the wire or cable needs to be moved relative to the photometer and this may introduce extraneous factors which affect the measurement, for example the orientation or distance of the surface of the wire may change between readings. In addition, we have determined that the point sampling of the mark and background may not give a true indication of the contrast. For example the xe2x80x9cwhitenessxe2x80x9d of the background or the xe2x80x9cblacknessxe2x80x9d of the mark may vary at different points and so single samples may not be representative. Also, we have found that the legibility of a character perceived by the human eye/brain depends on the contrast of the whole character rather than just a single point.
U.S. Pat. No. 5,268,580 discloses a bar code enhancement system in which an image of an article carrying a bar code is captured. The image is analysed by dividing the image into groups consisting of 2xc3x972 pixels. For each group three out of the four pixels are examined one at a time for contrast and the maximum and minimum values determined and used to obtain a value representing the contrast of that group. In this arrangement the contrast value is determined on the basis of a single xe2x80x9cmaximumxe2x80x9d and a single minimum.
Accordingly, we have developed a new contrast measuring system which enables contrast measurement and which offers new features and capabilities not available in current photometers. In our system, a two dimensional image of at least part of the mark and the background is captured so that the image may be sampled at several points and preferably across substantially the whole of the selected part of the captured image.
Accordingly, in one aspect, this invention provides apparatus for determining the contrast of a mark, said apparatus comprising:
image sensor means for capturing a two-dimensional image of at least part of said mark and a background,
means for sampling said captured image over a plurality of pixels in the mark and over a plurality of pixels in the background, to obtain respective intensity values for pixels in said mark and pixels in said background respectively, and
contrast determining means for determining the contrast of said mark based on an aggregate or average of said intensity values for pixels in the mark, and an aggregate or average of said intensity values for pixels in the background.
The apparatus of the invention may be used to take just a few point samples from the mark and the background under the same background conditions simultaneously, as opposed to the earlier conventional arrangements which provided samples one after the other. It is however preferred to take a series of samples across the whole of the mark and the adjacent background and to use these sample points to provide a measure of contrast.
The image sensor preferably comprises a two dimensional CCD array sensor. The sensor is preferably provided with an optical system selected with regard to the character size of the marks so that the field of view of the sensor is sufficient to contain a complete character and a generous amount of background.
The apparatus preferably includes means for designating an area of the captured image in which the samples for contrast measurement are to be taken. In this way an operator may designate the required character and background, cutting out any extraneous part of the image which might give rise to error.
Where the image sensor is a CCD array or other sensor giving pixel values, the contrast determining means preferably takes the pixel values in the image (or the selected part thereof) and thresholds the pixel intensity values to categorise pixels having an intensity less than a first preset value as xe2x80x9cblackxe2x80x9d and pixels having an intensity greater than a second preset value as xe2x80x9cwhitexe2x80x9d. Pixels having intermediate pixel intensity values be categorised as an intermediate grey range, and are not used for contrast measurement. The contrast determining means preferably derives a value corresponding to the aggregate or average of the xe2x80x9cblackxe2x80x9d pixel intensity values and likewise a value for the aggregate or average of the xe2x80x9cwhitexe2x80x9d pixel values and uses these aggregates or values to derive the contrast measurement. For example, the contrast measurement may be obtained from the formula:
(Imaxxe2x88x92Imin)/Imax 
where Imax is the average intensity value of the xe2x80x9cwhitexe2x80x9d pixels and Imin the average intensity value of the xe2x80x9cblackxe2x80x9d pixels.
It will however be appreciated that the sample values may be processed differently to derive a measurement of contrast. Equally, having captured the image, other image analysis techniques may be used to derive further measurements of legibility. For example, the sample values may be analysed to determine the sharpness or crispness of the boundary of the mark, and so on.
In another aspect, this invention provides a method for determining the contrast of a mark, said method including the steps of:
(i) capturing a two-dimensional image of at least part of said mark and a background,
(ii) sampling said captured image over a plurality of pixels in the mark and over a plurality of pixels in the background, to obtain intensity values for pixels in said mark and in said background respectively, and
(iii) determining the contrast of said mark based on an aggregate or average value of said intensity values of pixels in said mark, and an aggregate or average value of said intensity value of pixels in said background.